﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine; 
 
public class SqlDataBase
{
    public virtual SqlDataBase InitWithSqlData(Dictionary<string, object> _data)
    {
        return null;
    }
}
  
public class GameData : SqlDataBase
{
    public int id;
    public string name;
    public int type;
    public string  context;
    public int num; 
    public int exp;
 
    public static GameData Copy(GameData other)
    {
        GameData ret = new GameData();
        ret.id = other.id;
        ret.type = other.type;
        ret.name = other.name;
        ret.context = other.context; 
        ret.num =other.num;
        ret.exp = other.exp;
 
        return ret;
    }
    public override SqlDataBase InitWithSqlData(Dictionary<string, object> data)
    {
        this.id = System.Convert.ToInt32(data["id"]);
        this.name = System.Convert.ToString(data["name"]);
        this.type = System.Convert.ToInt32(data["type"]);
        this.context = System.Convert.ToString(data["context"]);
        this.num = System.Convert.ToInt32(data["num"]);
        this.exp = System.Convert.ToInt32(data["exp"]);
 
        return this;
    }
}
 